package com.ciei.dpagm.controller;


import com.alibaba.fastjson.JSONObject;
import com.ciei.dpagm.common.controller.BaseController;
import com.ciei.dpagm.common.enums.LogTypeEnum;
import com.ciei.dpagm.service.ParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("parameter")
public class ParameterController extends BaseController {

	@Autowired
	private ParameterService parameterService;

	@RequestMapping("loadGrid")
	@ResponseBody
	public JSONObject loadGrid(@RequestBody JSONObject query){
		return parameterService.loadGrid(query);
	}

	@RequestMapping("add")
	@ResponseBody
	public JSONObject add(@RequestBody JSONObject data){
		return parameterService.add(data);
	}

	@RequestMapping("update")
	@ResponseBody
	public JSONObject update(@RequestBody JSONObject data){
		return parameterService.update(data);
	}

	@RequestMapping("delete")
	@ResponseBody
	public JSONObject delete(@RequestBody JSONObject data){
		return parameterService.delete(data);
	}

	@RequestMapping("loadDataTypeOptionList")
	@ResponseBody
	public JSONObject loadDataTypeOptionList(){
		return parameterService.loadDataTypeOptionList();
	}

}
